<?php
namespace app\admin\model;
use think\Model;
use think\Db;
class Returns extends Model
{
	public function index(){
		$all = input('get.all');
		$key = input('get.key');
		//显示全部数据
		if($all == 1){
           $data = DB::table('ma_usermoneylog')->alias('a')->join('ma_users b','a.uid = b.uid')->field('b.username,a.*')->order('id desc')->select();
		}else{
		   $data = DB::table('ma_usermoneylog')->alias('a')->join('ma_users b','a.uid = b.uid')->field('b.username,a.*')->where('b.username|a.users','like',"%".$key."%")->order('id desc')->paginate(15);
		}
		return $data;
	}
}